import openpyxl

myBook=openpyxl.load_workbook('员工表.xlsx')
mySheet=myBook.active
mySheet.auto_filter.ref='A1:D12'
mySheet.auto_filter.add_filter_column(3,['博士'])
myBook.save('结果表-员工表.xlsx')